<?php include 'inc/student_head.php'; ?>


<div class="openDiv">
    <div style="height:20px;text-align: left;position: relative;z-index: 999;">
    </div>

    <div id='todayTask'>
        <a href="/student/downTask?taskID=<?= gs('setup')['task_id'] ?>"
            title='单击下载' class='layui-btn layui-btn-radius'>
            <?php
            $rad=random_int(1,1);
            printf('<img src="/statics/imgs/i0%s.png" style="width:32px;" />',$rad);
            ?>
            本节课程: <?= gs('setup')['task_name'] ?>




        </a>
    </div>

    <div class="layui-upload-drag" id='upload' style="margin-top:20px;">
        <i class="layui-icon">&#xe67c;</i>
        <div style="letter-spacing: 0.2em;font-size:12pt;">
            点此上传，或将作业文件拖到此处
        </div>
    </div>

    <div class='uploaded'>
    <?php if (@$this->filesize > 0) { ?>
        <a href="/student/downZY?taskID=<?= gs('setup')['task_id'] ?>">
        已成功上传本节作业，文件大小为 <?= $this->filesize ?> </a>
    <?php } ?>
    </div>

    <div style="height:30px;"></div>

</div>




<script language="javascript">
    layui.use(['upload', 'element', 'layer'], function() {
        var upload = layui.upload,
            util = layui.util,
            $ = layui.$;

//询问是否跳转复习网站
// layer.confirm('是否访问复习专用网站?', {icon: 3,offset: '40px', title:'提示'}, function(index){
//   window.location.href="http://192.168.102.252:88";
//   layer.close(index);

// });

// 今天课程
layer.open({
    type: 1,
    title: '&nbsp;',
    closeBtn: 0,
    anim: 0,
    scrollbar: false,
    area: ['500px'],
    //offset: ['250px', '100px'],
    shade: false,
    content: $('.openDiv'),

});



$("#menu_index").addClass('layui-this'); //设置导航当前选中项的样式


//拖拽上传
upload.render({
    elem: '#upload'
    , url: 'upZY'
    , accept: 'file' //普通文件
    //, exts: 'rar|zip|7z|txt|py|docx|doc|xlsx|xls' //允许上传的文件类型
    //, acceptMime: '.rar,.zip,.7z,.txt,.py,.docx,.doc,.xlsx,.xls' //打开文件框筛选文件类型
    , size: 20 * 1024 //限制文件大小，单位KB
    , before: function() {
        this.data = {'task': <?=gs('setup')['task_id'] ?>}; //传递参数
    }
    , done: function(res) {
        console.log(res);
        layer.alert(res.msg, {icon: 6 }, function() {
            location.reload();
        });

    }
});


});
</script>


<?php include 'inc/student_foot.php'; ?>


